home *** CD-ROM | disk | FTP | other *** search
-
- # line 2 "closyacc.y"
- /* CLOS */
- /* Scritto nel 1990-91-92 da Zoia Andrea Michele */
- /* Via Pergola #1 Tirano (SO) Tel. 0342-704210 */
- #include"clos.h"
- #include"closerr.h"
-
- #define YYMAXDEPTH 1000 /* Yacc stack depth */
- #define PROMPT { sprintf(buf1,"%s",yacc_prompt);\
- lisp_print_string(buf1,yacc_fileout);}
- #define PROMPTP { sprintf(buf1,"%u%s",parcount,yacc_prompt);\
- lisp_print_string(buf1,yacc_fileout);}
-
- extern int parcount;
- int yywrapcalled;
- node yyret;
- char *yacc_prompt;
- FILE *yacc_filein;
- FILE *yacc_fileout;
-
- int yywrap();
- int yyerror();
-
- node input_func(fin,fout,pr)
- FILE *fin;
- FILE *fout;
- char *pr;
- {
- yacc_filein=fin;yacc_fileout=fout;
- parcount=0;yacc_prompt=pr;
- yywrapcalled=FALSE;
- if(yyparse()){ /* error... */
- if(yywrapcalled)
- error(E_EOF,ERR_MERROR|ERR_PVOID|ERR_TNORM,NULL);
- else{
- error(E_YACCSTACK,ERR_MERROR|ERR_PVOID|ERR_TNORM,NULL);
- /* svuota il buffer d'ingresso */
- while(lisp_get_char(yacc_filein)!='\n');
- }
- PROMPT;
- /* ritorna al main-loop */
- error(E_ZERO,ERR_MNONE|ERR_PVOID|ERR_TBLVL,NULL);
- }
- if(yyret==VOID){
- PROMPT;
- /* ritorna al main-loop */
- /* error(E_ZERO,ERR_MNONE|ERR_PVOID|ERR_TBLVL,NULL); */
- }
- return yyret;
- }
-
- int yywrap()
- { return yywrapcalled=TRUE; }
-
- int yyerror(s)
- char *s;
- { return TRUE; }
-
-
- # line 61 "closyacc.y"
- typedef union {
- char *ident;
- double real;
- long int integer;
- node s_expr;
- } YYSTYPE;
- # define IDENTIFIER_YY 257
- # define STRING_YY 258
- # define INTEGER_YY 259
- # define REAL_YY 260
- # define BAD_CHAR_YY 261
- # define BAD_STRING_YY 262
- # define BAD_SQB_YY 263
- #define yyclearin yychar = -1
- #define yyerrok yyerrflag = 0
- extern int yychar;
- extern int yyerrflag;
- #ifndef YYMAXDEPTH
- #define YYMAXDEPTH 150
- #endif
- YYSTYPE yylval, yyval;
- typedef int yytabelem;
- # define YYERRCODE 256
-
- # line 182 "closyacc.y"
-
-
- yytabelem yyexca[] ={
- -1, 0,
- 257, 22,
- 258, 22,
- 259, 22,
- 260, 22,
- 261, 22,
- 262, 22,
- 263, 22,
- 10, 22,
- 40, 22,
- 38, 22,
- 58, 22,
- 39, 22,
- 44, 22,
- 126, 22,
- 35, 22,
- -2, 0,
- -1, 1,
- 0, -1,
- -2, 0,
- };
- # define YYNPROD 24
- # define YYLAST 271
- yytabelem yyact[]={
-
- 5, 26, 25, 21, 3, 32, 16, 18, 8, 23,
- 5, 36, 19, 35, 22, 1, 7, 5, 6, 5,
- 0, 0, 0, 0, 0, 21, 17, 0, 16, 18,
- 8, 34, 0, 0, 19, 21, 40, 0, 16, 18,
- 8, 34, 21, 38, 19, 16, 18, 8, 17, 33,
- 44, 19, 4, 0, 2, 0, 0, 0, 17, 0,
- 0, 0, 0, 24, 0, 17, 27, 28, 29, 30,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 37, 0, 0, 0, 0, 0, 39, 0,
- 0, 42, 0, 0, 20, 41, 0, 43, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
- 0, 0, 0, 20, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 12, 11, 9, 10, 13,
- 14, 15, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 12, 11, 9,
- 10, 13, 14, 15, 0, 0, 0, 12, 11, 9,
- 10, 13, 14, 15, 12, 11, 9, 10, 13, 14,
- 15 };
- yytabelem yypact[]={
-
- -252, -3000, 7, 4, -3000, -3000, -3000, -3000, -3000, -3000,
- -3000, -3000, -3000, -254, -3000, -255, -32, -32, -32, -32,
- -32, -34, -3000, -3000, 0, 3, 1, -3000, -3000, -3000,
- -3000, -3000, -32, -3000, -3000, -3000, -3000, -3000, -3000, -10,
- -3000, 7, -3000, 9, -3000 };
- yytabelem yypgo[]={
-
- 0, 18, 9, 16, 49, 15, 54 };
- yytabelem yyr1[]={
-
- 0, 5, 5, 4, 4, 4, 1, 1, 1, 1,
- 1, 1, 1, 3, 3, 3, 3, 3, 3, 2,
- 2, 2, 6, 6 };
- yytabelem yyr2[]={
-
- 0, 5, 5, 3, 3, 5, 3, 3, 3, 3,
- 7, 3, 7, 5, 5, 5, 5, 5, 7, 7,
- 5, 17, 0, 5 };
- yytabelem yychk[]={
-
- -3000, -5, -6, 256, -4, 10, -1, -3, 40, 259,
- 260, 258, 257, 261, 262, 263, 38, 58, 39, 44,
- 126, 35, 10, -2, -6, 256, 256, -4, -4, -4,
- -4, -4, 39, -4, 41, 10, 10, -4, -2, -6,
- 46, -6, -4, -6, 41 };
- yytabelem yydef[]={
-
- -2, -2, 0, 0, 1, 23, 3, 4, 22, 6,
- 7, 8, 9, 0, 11, 0, 0, 0, 0, 0,
- 0, 0, 2, 5, 0, 0, 0, 13, 14, 15,
- 16, 17, 0, 22, 20, 10, 12, 18, 19, 0,
- 22, 0, 22, 0, 21 };
- typedef struct { char *t_name; int t_val; } yytoktype;
- #ifndef YYDEBUG
- # define YYDEBUG 0 /* don't allow debugging */
- #endif
-
- #if YYDEBUG
-
- yytoktype yytoks[] =
- {
- "IDENTIFIER_YY", 257,
- "STRING_YY", 258,
- "INTEGER_YY", 259,
- "REAL_YY", 260,
- "BAD_CHAR_YY", 261,
- "BAD_STRING_YY", 262,
- "BAD_SQB_YY", 263,
- "-unknown-", -1 /* ends search */
- };
-
- char * yyreds[] =
- {
- "-no such reduction-",
- "ass : n sexpr",
- "ass : error '\n'",
- "sexpr : atom",
- "sexpr : macro",
- "sexpr : '(' list",
- "atom : INTEGER_YY",
- "atom : REAL_YY",
- "atom : STRING_YY",
- "atom : IDENTIFIER_YY",
- "atom : BAD_CHAR_YY error '\n'",
- "atom : BAD_STRING_YY",
- "atom : BAD_SQB_YY error '\n'",
- "macro : '&' sexpr",
- "macro : ':' sexpr",
- "macro : '\'' sexpr",
- "macro : ',' sexpr",
- "macro : '~' sexpr",
- "macro : '#' '\'' sexpr",
- "list : n sexpr list",
- "list : n ')'",
- "list : n sexpr n '.' n sexpr n ')'",
- "n : /* empty */",
- "n : n '\n'",
- };
- #endif /* YYDEBUG */
- #define YYFLAG (-3000)
- /* @(#) $Revision: 64.2 $ */
-
- /*
- ** Skeleton parser driver for yacc output
- */
-
- #if defined(NLS) && !defined(NL_SETN)
- #include <msgbuf.h>
- #endif
-
- #ifndef nl_msg
- #define nl_msg(i,s) (s)
- #endif
-
- /*
- ** yacc user known macros and defines
- */
- #define YYERROR goto yyerrlab
-
- #ifndef __RUNTIME_YYMAXDEPTH
- #define YYACCEPT return(0)
- #define YYABORT return(1)
- #else
- #define YYACCEPT {free_stacks(); return(0);}
- #define YYABORT {free_stacks(); return(1);}
- #endif
-
- #define YYBACKUP( newtoken, newvalue )\
- {\
- if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
- {\
- yyerror( (nl_msg(30001,"syntax error - cannot backup")) );\
- goto yyerrlab;\
- }\
- yychar = newtoken;\
- yystate = *yyps;\
- yylval = newvalue;\
- goto yynewstate;\
- }
- #define YYRECOVERING() (!!yyerrflag)
- #ifndef YYDEBUG
- # define YYDEBUG 1 /* make debugging available */
- #endif
-
- /*
- ** user known globals
- */
- int yydebug; /* set to 1 to get debugging */
-
- /*
- ** driver internal defines
- */
- /* define for YYFLAG now generated by yacc program. */
- /*#define YYFLAG (FLAGVAL)*/
-
- /*
- ** global variables used by the parser
- */
- # ifndef __RUNTIME_YYMAXDEPTH
- YYSTYPE yyv[ YYMAXDEPTH ]; /* value stack */
- int yys[ YYMAXDEPTH ]; /* state stack */
- # else
- YYSTYPE *yyv; /* pointer to malloc'ed value stack */
- int *yys; /* pointer to malloc'ed stack stack */
- extern char *malloc(), *realloc();
- extern void free();
- int allocate_stacks();
- void free_stacks();
- # ifndef YYINCREMENT
- # define YYINCREMENT (YYMAXDEPTH/2) + 10
- # endif
- # endif
- long yymaxdepth = YYMAXDEPTH;
-
- YYSTYPE *yypv; /* top of value stack */
- int *yyps; /* top of state stack */
-
- int yystate; /* current state */
- int yytmp; /* extra var (lasts between blocks) */
-
- int yynerrs; /* number of errors */
- int yyerrflag; /* error recovery flag */
- int yychar; /* current input token number */
-
-
-
- /*
- ** yyparse - return 0 if worked, 1 if syntax error not recovered from
- */
- int
- yyparse()
- {
- register YYSTYPE *yypvt; /* top of value stack for $vars */
-
- /*
- ** Initialize externals - yyparse may be called more than once
- */
- # ifdef __RUNTIME_YYMAXDEPTH
- if (allocate_stacks()) YYABORT;
- # endif
- yypv = &yyv[-1];
- yyps = &yys[-1];
- yystate = 0;
- yytmp = 0;
- yynerrs = 0;
- yyerrflag = 0;
- yychar = -1;
-
- goto yystack;
- {
- register YYSTYPE *yy_pv; /* top of value stack */
- register int *yy_ps; /* top of state stack */
- register int yy_state; /* current state */
- register int yy_n; /* internal state number info */
-
- /*
- ** get globals into registers.
- ** branch to here only if YYBACKUP was called.
- */
- yynewstate:
- yy_pv = yypv;
- yy_ps = yyps;
- yy_state = yystate;
- goto yy_newstate;
-
- /*
- ** get globals into registers.
- ** either we just started, or we just finished a reduction
- */
- yystack:
- yy_pv = yypv;
- yy_ps = yyps;
- yy_state = yystate;
-
- /*
- ** top of for (;;) loop while no reductions done
- */
- yy_stack:
- /*
- ** put a state and value onto the stacks
- */
- #if YYDEBUG
- /*
- ** if debugging, look up token value in list of value vs.
- ** name pairs. 0 and negative (-1) are special values.
- ** Note: linear search is used since time is not a real
- ** consideration while debugging.
- */
- if ( yydebug )
- {
- register int yy_i;
-
- printf( "State %d, token ", yy_state );
- if ( yychar == 0 )
- printf( "end-of-file\n" );
- else if ( yychar < 0 )
- printf( "-none-\n" );
- else
- {
- for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val == yychar )
- break;
- }
- printf( "%s\n", yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */
- {
- # ifndef __RUNTIME_YYMAXDEPTH
- yyerror( (nl_msg(30002,"yacc stack overflow")) );
- YYABORT;
- # else
- /* save old stack bases to recalculate pointers */
- YYSTYPE * yyv_old = yyv;
- int * yys_old = yys;
- yymaxdepth += YYINCREMENT;
- yys = (int *) realloc(yys, yymaxdepth * sizeof(int));
- yyv = (YYSTYPE *) realloc(yyv, yymaxdepth * sizeof(YYSTYPE));
- if (yys==0 || yyv==0) {
- yyerror( (nl_msg(30002,"yacc stack overflow")) );
- YYABORT;
- }
- /* Reset pointers into stack */
- yy_ps = (yy_ps - yys_old) + yys;
- yyps = (yyps - yys_old) + yys;
- yy_pv = (yy_pv - yyv_old) + yyv;
- yypv = (yypv - yyv_old) + yyv;
- # endif
-
- }
- *yy_ps = yy_state;
- *++yy_pv = yyval;
-
- /*
- ** we have a new state - find out what to do
- */
- yy_newstate:
- if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
- goto yydefault; /* simple state */
- #if YYDEBUG
- /*
- ** if debugging, need to mark whether new token grabbed
- */
- yytmp = yychar < 0;
- #endif
- if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
- yychar = 0; /* reached EOF */
- #if YYDEBUG
- if ( yydebug && yytmp )
- {
- register int yy_i;
-
- printf( "Received token " );
- if ( yychar == 0 )
- printf( "end-of-file\n" );
- else if ( yychar < 0 )
- printf( "-none-\n" );
- else
- {
- for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val == yychar )
- break;
- }
- printf( "%s\n", yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
- goto yydefault;
- if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/
- {
- yychar = -1;
- yyval = yylval;
- yy_state = yy_n;
- if ( yyerrflag > 0 )
- yyerrflag--;
- goto yy_stack;
- }
-
- yydefault:
- if ( ( yy_n = yydef[ yy_state ] ) == -2 )
- {
- #if YYDEBUG
- yytmp = yychar < 0;
- #endif
- if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
- yychar = 0; /* reached EOF */
- #if YYDEBUG
- if ( yydebug && yytmp )
- {
- register int yy_i;
-
- printf( "Received token " );
- if ( yychar == 0 )
- printf( "end-of-file\n" );
- else if ( yychar < 0 )
- printf( "-none-\n" );
- else
- {
- for ( yy_i = 0;
- yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val
- == yychar )
- {
- break;
- }
- }
- printf( "%s\n", yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- /*
- ** look through exception table
- */
- {
- register int *yyxi = yyexca;
-
- while ( ( *yyxi != -1 ) ||
- ( yyxi[1] != yy_state ) )
- {
- yyxi += 2;
- }
- while ( ( *(yyxi += 2) >= 0 ) &&
- ( *yyxi != yychar ) )
- ;
- if ( ( yy_n = yyxi[1] ) < 0 )
- YYACCEPT;
- }
- }
-
- /*
- ** check for syntax error
- */
- if ( yy_n == 0 ) /* have an error */
- {
- /* no worry about speed here! */
- switch ( yyerrflag )
- {
- case 0: /* new error */
- yyerror( (nl_msg(30003,"syntax error")) );
- yynerrs++;
- goto skip_init;
- yyerrlab:
- /*
- ** get globals into registers.
- ** we have a user generated syntax type error
- */
- yy_pv = yypv;
- yy_ps = yyps;
- yy_state = yystate;
- yynerrs++;
- skip_init:
- case 1:
- case 2: /* incompletely recovered error */
- /* try again... */
- yyerrflag = 3;
- /*
- ** find state where "error" is a legal
- ** shift action
- */
- while ( yy_ps >= yys )
- {
- yy_n = yypact[ *yy_ps ] + YYERRCODE;
- if ( yy_n >= 0 && yy_n < YYLAST &&
- yychk[yyact[yy_n]] == YYERRCODE) {
- /*
- ** simulate shift of "error"
- */
- yy_state = yyact[ yy_n ];
- goto yy_stack;
- }
- /*
- ** current state has no shift on
- ** "error", pop stack
- */
- #if YYDEBUG
- # define _POP_ "Error recovery pops state %d, uncovers state %d\n"
- if ( yydebug )
- printf( _POP_, *yy_ps,
- yy_ps[-1] );
- # undef _POP_
- #endif
- yy_ps--;
- yy_pv--;
- }
- /*
- ** there is no state on stack with "error" as
- ** a valid shift. give up.
- */
- YYABORT;
- case 3: /* no shift yet; eat a token */
- #if YYDEBUG
- /*
- ** if debugging, look up token in list of
- ** pairs. 0 and negative shouldn't occur,
- ** but since timing doesn't matter when
- ** debugging, it doesn't hurt to leave the
- ** tests here.
- */
- if ( yydebug )
- {
- register int yy_i;
-
- printf( "Error recovery discards " );
- if ( yychar == 0 )
- printf( "token end-of-file\n" );
- else if ( yychar < 0 )
- printf( "token -none-\n" );
- else
- {
- for ( yy_i = 0;
- yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val
- == yychar )
- {
- break;
- }
- }
- printf( "token %s\n",
- yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- if ( yychar == 0 ) /* reached EOF. quit */
- YYABORT;
- yychar = -1;
- goto yy_newstate;
- }
- }/* end if ( yy_n == 0 ) */
- /*
- ** reduction by production yy_n
- ** put stack tops, etc. so things right after switch
- */
- #if YYDEBUG
- /*
- ** if debugging, print the string that is the user's
- ** specification of the reduction which is just about
- ** to be done.
- */
- if ( yydebug )
- printf( "Reduce by (%d) \"%s\"\n",
- yy_n, yyreds[ yy_n ] );
- #endif
- yytmp = yy_n; /* value to switch over */
- yypvt = yy_pv; /* $vars top of value stack */
- /*
- ** Look in goto table for next state
- ** Sorry about using yy_state here as temporary
- ** register variable, but why not, if it works...
- ** If yyr2[ yy_n ] doesn't have the low order bit
- ** set, then there is no action to be done for
- ** this reduction. So, no saving & unsaving of
- ** registers done. The only difference between the
- ** code just after the if and the body of the if is
- ** the goto yy_stack in the body. This way the test
- ** can be made before the choice of what to do is needed.
- */
- {
- /* length of production doubled with extra bit */
- register int yy_len = yyr2[ yy_n ];
-
- if ( !( yy_len & 01 ) )
- {
- yy_len >>= 1;
- yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
- yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
- *( yy_ps -= yy_len ) + 1;
- if ( yy_state >= YYLAST ||
- yychk[ yy_state =
- yyact[ yy_state ] ] != -yy_n )
- {
- yy_state = yyact[ yypgo[ yy_n ] ];
- }
- goto yy_stack;
- }
- yy_len >>= 1;
- yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
- yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
- *( yy_ps -= yy_len ) + 1;
- if ( yy_state >= YYLAST ||
- yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
- {
- yy_state = yyact[ yypgo[ yy_n ] ];
- }
- }
- /* save until reenter driver code */
- yystate = yy_state;
- yyps = yy_ps;
- yypv = yy_pv;
- }
- /*
- ** code supplied by user is placed in this switch
- */
- switch( yytmp )
- {
-
- case 1:
- # line 84 "closyacc.y"
- {yyret=yypvt[-0].s_expr;YYACCEPT;} break;
- case 2:
- # line 86 "closyacc.y"
- { error(E_SYNTAX,ERR_MERROR|ERR_PVOID|ERR_TNORM,NULL);
- yyret=VOID;YYACCEPT;
- } break;
- case 3:
- # line 91 "closyacc.y"
- {yyval.s_expr=yypvt[-0].s_expr;} break;
- case 4:
- # line 92 "closyacc.y"
- {yyval.s_expr=yypvt[-0].s_expr;} break;
- case 5:
- # line 93 "closyacc.y"
- {yyval.s_expr=yypvt[-0].s_expr;} break;
- case 6:
- # line 97 "closyacc.y"
- { TYPE(yyval.s_expr=node_make())|=NT_IS_VALUE+NT_INTEGER;
- INTEGER(yyval.s_expr)=yypvt[-0].integer;
- } break;
- case 7:
- # line 101 "closyacc.y"
- { TYPE(yyval.s_expr=node_make())|=NT_IS_VALUE+NT_REAL;
- REAL(yyval.s_expr)=yypvt[-0].real;
- } break;
- case 8:
- # line 105 "closyacc.y"
- { yyval.s_expr=node_make();STRING(yyval.s_expr)=string_put(yypvt[-0].ident,yyval.s_expr);
- TYPE(yyval.s_expr)|=NT_IS_VALUE+NT_STRING;
- } break;
- case 9:
- # line 109 "closyacc.y"
- { yyval.s_expr=node_alloc(yypvt[-0].ident);
- } break;
- case 10:
- # line 112 "closyacc.y"
- { sprintf(buf1,"Char '%c' ascii %i",(char)yypvt[-2].integer,(int)yypvt[-2].integer);
- error(E_BADCH,ERR_MERROR|ERR_TNORM|ERR_PSTRING,buf1);
- yyret=VOID;YYACCEPT;
- } break;
- case 11:
- # line 117 "closyacc.y"
- {
- error(E_BADSTRING,ERR_MERROR|ERR_TNORM|ERR_PVOID,NULL);
- yyret=VOID;YYACCEPT;
- } break;
- case 12:
- # line 122 "closyacc.y"
- {
- error(E_INVALIDSQB,ERR_MERROR|ERR_TNORM|ERR_PVOID,NULL);
- yyret=VOID;YYACCEPT;
- } break;
- case 13:
- # line 129 "closyacc.y"
- { TYPE(yyval.s_expr=node_make())|=NT_IS_VALUE+NT_ENAME;
- ENAME(yyval.s_expr)=yypvt[-0].s_expr;
- } break;
- case 14:
- # line 133 "closyacc.y"
- { TYPE(yyval.s_expr=node_make())|=NT_IS_VALUE+NT_CNAME;
- ENAME(yyval.s_expr)=yypvt[-0].s_expr;
- } break;
- case 15:
- # line 137 "closyacc.y"
- { yyval.s_expr=node_make();CONSLEFT(yyval.s_expr)=node_alloc("QUOTE");
- CONSRIGHT(yyval.s_expr)=node_make();CONSLEFT(CONSRIGHT(yyval.s_expr))=yypvt[-0].s_expr;
- CONSRIGHT(CONSRIGHT(yyval.s_expr))=NIL;
- TYPE(yyval.s_expr)|=NT_IS_CONS;TYPE(CONSRIGHT(yyval.s_expr))|=NT_IS_CONS;
- } break;
- case 16:
- # line 143 "closyacc.y"
- { yyval.s_expr=node_make();CONSLEFT(yyval.s_expr)=node_alloc("COMA");
- CONSRIGHT(yyval.s_expr)=node_make();CONSLEFT(CONSRIGHT(yyval.s_expr))=yypvt[-0].s_expr;
- CONSRIGHT(CONSRIGHT(yyval.s_expr))=NIL;
- TYPE(yyval.s_expr)|=NT_IS_CONS;TYPE(CONSRIGHT(yyval.s_expr))|=NT_IS_CONS;
- } break;
- case 17:
- # line 149 "closyacc.y"
- { yyval.s_expr=node_make();CONSLEFT(yyval.s_expr)=node_alloc("BACKQUOTE");
- CONSRIGHT(yyval.s_expr)=node_make();CONSLEFT(CONSRIGHT(yyval.s_expr))=yypvt[-0].s_expr;
- CONSRIGHT(CONSRIGHT(yyval.s_expr))=NIL;
- TYPE(yyval.s_expr)|=NT_IS_CONS;TYPE(CONSRIGHT(yyval.s_expr))|=NT_IS_CONS;
- } break;
- case 18:
- # line 155 "closyacc.y"
- { yyval.s_expr=node_make();CONSLEFT(yyval.s_expr)=node_alloc("FUNCTION");
- CONSRIGHT(yyval.s_expr)=node_make();CONSLEFT(CONSRIGHT(yyval.s_expr))=yypvt[-0].s_expr;
- CONSRIGHT(CONSRIGHT(yyval.s_expr))=NIL;
- TYPE(yyval.s_expr)|=NT_IS_CONS;TYPE(CONSRIGHT(yyval.s_expr))|=NT_IS_CONS;
- } break;
- case 19:
- # line 163 "closyacc.y"
- { TYPE(yyval.s_expr=node_make())|=NT_IS_CONS;
- CONSLEFT(yyval.s_expr)=yypvt[-1].s_expr;CONSRIGHT(yyval.s_expr)=yypvt[-0].s_expr;
- } break;
- case 20:
- # line 166 "closyacc.y"
- { yyval.s_expr=NIL;} break;
- case 21:
- # line 168 "closyacc.y"
- { TYPE(yyval.s_expr=node_make())|=NT_IS_CONS;
- CONSLEFT(yyval.s_expr)=yypvt[-6].s_expr;CONSRIGHT(yyval.s_expr)=yypvt[-2].s_expr;
- } break;
- case 23:
- # line 175 "closyacc.y"
- { if(parcount)
- PROMPTP
- else
- PROMPT
- } break;
- }
- goto yystack; /* reset registers in driver code */
- }
-
- # ifdef __RUNTIME_YYMAXDEPTH
-
- int allocate_stacks() {
- /* allocate the yys and yyv stacks */
- yys = (int *) malloc(yymaxdepth * sizeof(int));
- yyv = (YYSTYPE *) malloc(yymaxdepth * sizeof(YYSTYPE));
-
- if (yys==0 || yyv==0) {
- yyerror( (nl_msg(30004,"unable to allocate space for yacc stacks")) );
- return(1);
- }
- else return(0);
-
- }
-
-
- void free_stacks() {
- if (yys!=0) free(yys);
- if (yyv!=0) free(yyv);
- }
-
- # endif /* defined(__RUNTIME_YYMAXDEPTH) */
-
-